package com.code;

import java.awt.Component;
import java.lang.Thread.UncaughtExceptionHandler;

import javax.swing.JFrame;

import com.code.generator.model.GeneratorConfiguration;
import com.code.generator.model.GeneratorConfigurationBuilder;
import com.code.ui.ProjectGeneratorPanel;

public class CodeGenerator {

	public CodeGenerator() {
	}

	public static void main(String[] args) throws Exception {
		GeneratorConfiguration codeConfiguration = GeneratorConfigurationBuilder
				.build();
		final Object waitFor = new Object();
		Thread.currentThread().setUncaughtExceptionHandler(
				new UncaughtExceptionHandler() {
					public void uncaughtException(Thread thread,
							Throwable throwable) {
						Object var3 = waitFor;
						synchronized (waitFor) {
							waitFor.notifyAll();
						}
					}
				}); 

		try {
			JFrame ex = new JFrame("代码生成器V1.0");
			ex.setDefaultCloseOperation(3);
			ex.setBounds(100, 100, 900, 600);
			ex.getContentPane().add(
					new ProjectGeneratorPanel(codeConfiguration, ex));
			ex.setVisible(true);
			ex.setLocationRelativeTo((Component) null);
		} catch (Exception var8) {
			synchronized (waitFor) {
				waitFor.notifyAll();
			}

			throw var8;
		}

		synchronized (waitFor) {
			try {
				waitFor.wait();
			} catch (InterruptedException var6) {
				;
			}

		}
	}
}
